//网站禁止复制
document.oncontextmenu=new Function("event.returnValue=false");
document.onselectstart=new Function("event.returnValue=false");

$().ready(function () {
    //快速链接
    //fastLinkMargin();
      
    //底部保障
    //ensureMargin();

    //筛选更多与收起
    $('.filter_box').find(".more_btn").click(function(){
        var t = $(this).html();
        if(t == "更多&gt;"){
            $(this).html("收起&gt;")
            $(this).prev().css({'height':'auto'});
        }else{
            $(this).html("更多&gt;")
            $(this).prev().css({'height':'27px'});
        }
        
    });

    //产品主图放大
    $('.product_base_info').find('.phone_box .small_img').find('.list').click(function(){
        $(this).siblings().removeClass("select");
        $(this).addClass("select");
        var imgSrc = $(this).find('img').attr("big");
        $('.product_base_info').find('.phone_box .big_img').find("img").attr('src',imgSrc);
     });
     
     //产品滑动门
    $("[nameID]").click(function () {
        $(this).siblings().removeClass('active');
        $(this).addClass('active');
        $("[nameForId="+$(this).attr("nameID")+"]").siblings().addClass('disN').removeClass('disB');
        $("[nameForId="+$(this).attr("nameID")+"]").removeClass('disN').addClass('disB');
    });
})

function fastLinkMargin(){
    var fastListW = $('.fast_link a').width();
    var fastListLeft = parseInt($('.fast_link a').css("paddingLeft"))*2;
    console.log(fastListW);
    console.log(fastListLeft);
    var fastListMargin = $('.container').width() - (fastListW + fastListLeft)*7;
    console.log(fastListMargin);
    fastListMargin = fastListMargin / 6;
    $('.fast_link a').css({'marginLeft':fastListMargin+'px'});
    $('.fast_link a:first-child').css({'marginLeft':0});
}
function ensureMargin(){
    var ensureW = $('.footer_ensure .img_box').width();
    var ensureMargin = $('.footer_ensure .container').width() - ensureW*5;
    ensureMargin = ensureMargin / 4;
    $('.footer_ensure .img_box').css({'marginLeft':ensureMargin+'px'});
    $('.footer_ensure .img_box:first-child').css({'marginLeft':0});
}

window.onresize = function(){
    //快速链接
    //fastLinkMargin();
    //底部保障
    //ensureMargin();
}

function pageScroll(){
    window.scrollBy(0,-100);
    scrolldelay = setTimeout('pageScroll()',0);
    var sTop=document.documentElement.scrollTop+document.body.scrollTop;
    if(sTop==0) clearTimeout(scrolldelay);
}